/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.worsik.utils;

import java.text.DecimalFormat;

/**
 *
 * @author 231260
 */
public class DoubleFormat {
	
	public static String trim(Double d, int digits)
	{
		String pattern = "#.";
		for (int i=1; i<= digits; i++)
		{
			pattern += "#";
		}
		DecimalFormat df = new DecimalFormat(pattern);
		
		return df.format(d);
	}
	
	public static String trim2(Double d)
	{
		return trim(d,2);
	}
}
